//
//  NameInPutView.m
//  夺宝吧
//
//  Created by xiaocai on 15/7/21.
//  Copyright (c) 2015年 FangYuan. All rights reserved.
//

#import "NameInPutView.h"


@interface NameInPutView ()
{
    __weak IBOutlet UIButton *ensureBtn;
    __weak IBOutlet UIButton *cancelBtn;
    __weak IBOutlet UITextField *inputText;
    
}
@end
@implementation NameInPutView

- (void)awakeFromNib
{
    ensureBtn.layer.cornerRadius = 2;
    cancelBtn.layer.cornerRadius = 2;
    ensureBtn.layer.borderWidth = 1;
    cancelBtn.layer.borderWidth = 1;
    ensureBtn.layer.masksToBounds = YES;
    cancelBtn.layer.masksToBounds = YES;
    ensureBtn.layer.borderColor = [UIColor whiteColor].CGColor;
    cancelBtn.layer.borderColor = [UIColor lightGrayColor].CGColor;
    ensureBtn.backgroundColor = QBB_RED_COLOR;
    self.layer.borderWidth = 1;
    self.layer.borderColor = [UIColor blackColor].CGColor;
    self.layer.cornerRadius = 5;
    self.layer.masksToBounds = YES;
}
//设置默认值
- (void)morenzhi:(NSString *)name
{
    inputText.text = name;
}

- (IBAction)ensurebtnOnClick:(id)sender {
    if (inputText.text.length != 0) {
        [self.father changeName:inputText.text];
        [self removeFromSuperview];
    }
}

- (IBAction)cancelBtnOnClick:(id)sender {
    [self.father removeZheZhao];
    [self removeFromSuperview];
}
@end
